package com.itheima.app.manager.omsManager;

import cn.hutool.core.convert.Convert;
import com.itheima.domain.db.oms.OmsOrderSetting;
import com.itheima.service.omsService.OrderSettingService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * 订单设置
 *
 * @author DogeGuo
 */
@Component
public class OmsOrderSettingManager {
    @DubboReference
    OrderSettingService orderSettingService;

    /**
     * 获取指定订单设置
     *
     * @param id
     * @return
     */
    public OmsOrderSetting findById(Integer id) {
        return orderSettingService.findById(id);
    }

    /**
     * 修改指定订单设置
     *
     * @param id
     * @param omsOrderSetting
     */
    public void updateInfo(Integer id, OmsOrderSetting omsOrderSetting) {
        if (omsOrderSetting.getId() == null) {
            omsOrderSetting.setId(Convert.toLong(id));
        }
        orderSettingService.updateInfo(omsOrderSetting);
    }
}
